import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
import { Edgroup } from './edgroup.entity';

@Entity('school')
export class School {
  @PrimaryGeneratedColumn('increment')
  id: number;

  @ManyToOne(() => Edgroup, { onDelete: 'NO ACTION', onUpdate: 'NO ACTION' })
  @JoinColumn({ name: 'edgrp_id' })
  edgroup: Edgroup;

  @Column({ type: 'varchar', length: 255, default: '' })
  name: string;

  @Column({ type: 'varchar', length: 255, default: '' })
  photo: string;

  @Column({ type: 'boolean', default: false })
  deleted: boolean;
}
